import { createSlice } from "@reduxjs/toolkit";

// 初始化的数据
const initialState = {
  currentTheme: "light",
};

// 创建Slice
const themeSlice = createSlice({
  name:"theme",
  initialState,
  reducers:{
    setCurrentTheme(state,{payload}){
      state.currentTheme = payload
    }
  }
})

// 导出action
export const { setCurrentTheme } = themeSlice.actions
// 导出reducer
export default themeSlice.reducer
